/**
 * 菜单接口
 */

import { Get, Post, Put, Delete, RequestParams, ResponseData } from '../../common/decorator'

/**
 * 菜单服务
 */
export default class MenuService {
  @Get("/system/menu/list")
  listMenu(res: any) {
    const convertedResult: unknown = res as unknown;
    return convertedResult as Promise<ResponseData>
  }

  // 获取菜单路由
  @Get("/system/menu/getRouters", { requestType: 'params' })
  getRouters(res: { parentId: string | number }) {
    const convertedResult: unknown = res as unknown;
    return convertedResult as Promise<ResponseData>
  }

  // 查询菜单详细
  @Get("/system/menu/${menuId}", { requestType: 'path' })
  getMenu(res: { menuId: string }) {
    const convertedResult: unknown = res as unknown;
    return convertedResult as Promise<ResponseData>
  }

  // 查询菜单下拉树结构
  @Get("/system/menu/treeselect")
  treeselect(res: void) {
    const convertedResult: unknown = res as unknown;
    return convertedResult as Promise<ResponseData>
  }

  // 根据角色ID查询菜单下拉树结构
  @Get("/system/menu/roleMenuTreeselect/${roleId}", { requestType: "path" })
  roleMenuTreeselect(res: { roleId: string }) {
    const convertedResult: unknown = res as unknown;
    return convertedResult as Promise<ResponseData>
  }

  // 新增菜单
  @Post("/system/menu", { requestType: "data" })
  addMenu(res: any) {
    const convertedResult: unknown = res as unknown;
    return convertedResult as Promise<ResponseData>
  }

  // 修改菜单
  @Put("/system/menu", { requestType: 'data' })
  updateMenu(res: any) {
    const convertedResult: unknown = res as unknown;
    return convertedResult as Promise<ResponseData>
  }

  // 删除菜单
  @Delete("/system/menu/${menuId}", { requestType: "path" })
  delMenu(res: { menuId: string }) {
    const convertedResult: unknown = res as unknown;
    return convertedResult as Promise<ResponseData>
  }
}